package edu.hitsz.scoreDAO;

import java.text.SimpleDateFormat;
import java.util.Date;

public class UserInfo {
    private int rank;
    private String UserName;
    private int score;
    private String time;

    public UserInfo(String userName, int score) {
        this.UserName = userName;
        this.score = score;
        this.time = this.setTime();
    }

    public UserInfo(int rank, String UserName, int score, String time) {
        this.rank=rank;
        this.UserName=UserName;
        this.score=score;
        this.time=time;
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public String getUserName() {
        return UserName;
    }

    public int getScore() {
        return score;
    }

    public String getTime() {
        return time;
    }

    public String setTime() {
        Date date=new Date();
        SimpleDateFormat ft = new SimpleDateFormat ("MM-dd HH:mm");
        String finishTime=ft.format(date);
        System.out.println(date);
        System.out.println(finishTime);
        return finishTime;
    }
}
